PicklingError : What can cause this error in a function